package cn.iocoder.an.module.business.dal.mysql.keeptask;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.keeptask.KeepTaskDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.keeptask.vo.*;
import org.springframework.stereotype.Repository;

/**
 * 保养任务 Mapper
 *
 * @author zzy
 */
@Mapper
@Repository("KeepTaskMapper")
public interface KeepTaskMapper extends BaseMapperX<KeepTaskDO> {

    default PageResult<KeepTaskDO> selectPage(KeepTaskPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KeepTaskDO>()
                .eqIfPresent(KeepTaskDO::getEquipmentId, reqVO.getEquipmentId())
                .betweenIfPresent(KeepTaskDO::getStartTime, reqVO.getStartTime())
                .orderByDesc(KeepTaskDO::getId));
    }

}